<!-- 消息中心 -->
<template>
	<div class="systemPage-wrapper">
		<winFlowView v-if="showFlowView" :wfInstId="wfInstId" :instNodeId="instNodeId" @close="close" :wfInstUserId="msgId" :finish="finish" :acceptTime="acceptTime"></winFlowView>
		<cellView
			v-if="showCell"
			:nodeId="nodeId"
			:tinstNodeId="instNodeId"
			:getWorkRepdeptId="getWorkRepdeptId"
			:wpId="wpId"
			:tworkId="tworkId"
			@close="closeCell"
			:tdeptId="tdeptId"
			:acceptTime="acceptTime"
		></cellView>
		<cellView
			v-if="cellViewShow"
			:jhId="wpInstNodeId"
			:nodeId="nodeId"
			:funcId="funcId"
			:funcName="funcName"
			:getWorkRepdeptId="getWorkRepdeptId"
			:tdeptId="tdeptId"
			:wpId="wpId"
			:tworkId="tworkId"
			:wpInstNodeId="wpInstNodeId"
			:initParam="initParam"
			:businessInfo="businessInfo"
			@close="handleCellView"
			:acceptTime="acceptTime"
		></cellView>
		<cellView
			v-if="cellViewShow1"
			:jhId="wpInstNodeId"
			:nodeId="nodeId"
			:funcId="funcId"
			:funcName="funcName"
			:getWorkRepdeptId="getWorkRepdeptId"
			:tdeptId="tdeptId"
			:wpId="wpId"
			:tworkId="tworkId"
			:wpInstNodeId="wpInstNodeId"
			:initParam="initParam"
			:businessInfo="businessInfo"
			@close="handleCellView"
			:acceptTime="acceptTime"
		></cellView>
		<winBussiness-View
			v-if="bussinessViewShow"
			:wpId="wpId"
			:funcId="funcId"
			:tworkId="tworkId"
			:tinstNodeId="tinstNodeId"
			:funcName="funcName"
			:tdeptId="tdeptId"
			:initParam="initParam"
			:nodeId="nodeId"
			:wpInstId="wpInstId"
			:wpInstNodeId="wpInstNodeId"
			v-on:close="handleBussinessView"
			:wpInstUserId="msgId"
			:acceptTime="acceptTime"
		></winBussiness-View>
		<messager-Detail :isReceive="true" v-if="visable" @hide="hide" :dataForm="messagerForm" :isbrower="true" @query="queryData(0)"></messager-Detail>
		<div class="topbar">
			<span class="iconfont iconxitongpingtai-xiaoxizhongxin-zong"></span>
			<span>消息中心</span>
		</div>
		<div class="content">
			<messageType @goto="goto" ref="child" @work="work" />
			<div class="content-background" style="width: calc(100% - 234px); height: 100%">
				<div class="content-wrapper" style="width:100%">
					<div class="searches-wrapper" style="min-width: 800px;justify-content: normal;">
						<div class="buttons-wrapper">
							<div v-if="queryList.msgType == 5" :class="[multipleSelection.length > 0 && isAble ? 'systemButtonQuery' : 'systemButtonQuery systemButtonDisabled']" @click="read">
								<span style="margin: 0 auto">标为已读</span>
							</div>
						</div>
						<div class="query-wrapper">
							<!-- <el-button type="primary" @click="btnClick1">点击查看</el-button> -->
							<div class="query-box">
								<span class="span-name">状态:</span>
								<el-select v-model="queryList.state" placeholder="请选择" class="systemInput" @change="queryData(0)">
									<el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value"></el-option>
								</el-select>
							</div>
							<div class="query-box">
								<span class="span-name">创建时间:</span>
								<el-select class="systemInput" v-model="dateType" placeholder="请选择" clearable @change="change" value-key="id">
									<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
								</el-select>
							</div>
							<div class="query-box">
								<span class="span-name">类型:</span>
								<el-select class="systemInput" v-model="queryList.formType" placeholder="请选择" clearable @change="queryData(0)" value-key="value">
									<el-option v-for="item in formTypeOpt" :key="item.value" :label="item.name" :value="item.value"></el-option>
								</el-select>
							</div>
							<!-- <div class="query-box">
                <span class="span-name">时间选择:</span>
                <el-date-picker
                  value-format="yyyy-MM-dd HH:mm:ss"
                  v-model="beginTime1"
                  type="date"
                  placeholder="选择日期"
                  :editable="false"
                  @change="changeDate"
                ></el-date-picker>
              </div>
							<div class="query-box" v-show="queryList.msgType <= 2">
								<span class="span-name">项目名称:</span>
								<el-input v-model="queryList.xmmc" placeholder="请输入项目名称" class="systemInput" @keyup.enter.native="queryData(0)" clearable></el-input>
							</div>
							<div class="query-box" v-show="queryList.msgType <= 2">
								<span class="span-name">工程名称:</span>
								<el-input v-model="queryList.gcmc" placeholder="请输入工程名称" class="systemInput" clearable @keyup.enter.native="queryData(0)"></el-input>
							</div>
							<div class="query-box">
								<span class="span-name">关键词:</span>
								<el-input v-model="queryList.keyword" placeholder="请输入关键词" class="systemInput" clearable @keyup.enter.native="queryData(0)"></el-input>
							</div>
														<div class="systemButtonQuery query-box" @click="queryData(0)">
								<span>查询</span>
							</div> -->
						</div>
					</div>
					<el-table v-if="tableShow" :data="historyData">
						<el-table-column prop="name" label="编码"> </el-table-column>
						<el-table-column prop="name" label="项目名称"> </el-table-column>
						<el-table-column prop="name" label="功能"> </el-table-column>
					</el-table>
					<el-table
						class="systemTable"
						v-else
						:highlight-current-row="true"
						stripe
						:data="historyData"
						ref="multipleTable"
						:height="tableHeight"
						max-height="calc(100%)"
						size="medium"
						row-class-name="row"
						cell-class-name="column"
						@selection-change="handleSelectionChange"
						@select="select"
						@select-all="selectAll"
						@row-dblclick="dblclick"
						@row-click="rowClick"
						:fit="true"
					>
						<el-table-column type="selection" width="55"></el-table-column>
						<el-table-column min-width="80" v-for="(item, index) in tableLabel" :key="index" :prop="item.prop" :width="item.width" :label="item.label" align="left" :show-overflow-tooltip="true">
							<template slot-scope="scope">
								<template v-if="item.prop === 'state'">
									<template v-if="queryList.msgType <= 2">
										<span v-if="scope.row.state == 0" style="color: rgba(51, 153, 255, 1)">未处理</span>
										<span v-if="scope.row.state == 1" style="color: rgba(51, 153, 255, 1)">已处理</span>
									</template>
									<template v-else-if="queryList.msgType > 2">
										<span v-if="scope.row.state == 0" style="color: rgba(51, 153, 255, 1)">未读</span>
										<span v-if="scope.row.state == 1" style="color: rgba(51, 153, 255, 1)">已读</span>
									</template>
								</template>
								<template v-else-if="item.prop !== 'state' && item.prop == 'grade'">
									<span v-if="scope.row.grade === 0" style="color: rgba(111, 178, 117, 1)">一般</span>
									<span v-if="scope.row.grade === 1" style="color: rgba(83, 168, 255, 1)">重要</span>
									<span v-if="scope.row.grade === 2" style="color: rgba(249, 73, 99, 1)">紧急</span>
								</template>
								<template v-else-if="item.prop !== 'grade' && item.prop !== 'state'">{{ scope.row[scope.column.property] }}</template>
							</template>
						</el-table-column>
						<el-table-column width="100" label="操作" align="center">
							<template slot-scope="scope">
								<el-button v-if="tableShow" @click="handleClick(scope.row)" type="text" size="mini" icon="el-icon-plus">新增</el-button>
								<el-button v-else @click="handleClick(scope.row)" type="text" size="mini" icon="iconfont iconkuangjia-sousuo">查看</el-button>
								<!-- <el-button v-if="false" @click="handleDelete(scope.row)" type="text" size="mini" icon="iconfont iconbiaoge-shanchu">删除</el-button>
                <el-button @click="handleEdit(scope.row)" type="text" size="mini" icon="iconfont iconbiaoge-bianji">编辑</el-button>-->
							</template>
						</el-table-column>
					</el-table>
					<el-pagination
						class="systemPagination"
						v-if="!tableShow"
						@size-change="handleSizeChange"
						@current-change="handleCurrentChange"
						:current-page="currentPage"
						:page-sizes="pageSizes"
						:page-size="queryList.pageSize"
						background
						layout="sizes,slot, prev, pager, next, jumper"
						:total="total"
					>
						<span class="totalCount">从{{ start }}到{{ end }}/共{{ total }}条数据</span>
					</el-pagination>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import messageType from '../components/message/messageType.vue'
	import cellView from '@/system/pages/cellView.vue'
	import winBussinessView from '@/system/components/winBussinessView.vue'
	import winFlowView from '@/system/components/winFlowView.vue'
	import messagerDetail from '../components/message/messagerDetail.vue'
	import { msgList, msgRead, msgState, msgDetail, workList } from '@/system/api/message'
	import { wpmessage } from '@/system/api/bussinessView'
	export default {
		components: {
			messageType,
			winFlowView,
			messagerDetail,
			cellView,
			winBussinessView,
		},
		data() {
			return {
				getWorkRepdeptId: '',
				showCell: false,
				finish: false,
				msgId: 0,
				//所属模块类型
				modules: [
					{
						label: '项目管理',
						value: 1,
					},
				],
				//接受到信使详情
				messagerForm: {},
				// 业务模型变量
				cellViewShow1: false,
				cellViewShow: false,
				bussinessViewShow: false,
				funcId: '',
				funcName: '',
				tdeptId: '',
				wpPlanId: '',
				wpNodeId: '',
				wpInstNodeId: '',
				wpId: '',
				tworkId: '',
				nodeId: '',
				tinstNodeId: '',
				wpInstId: '',
				acceptTime: '', //接受到消息的时间
				initParam: {},
				businessInfo: null,
				// 业务模型变量
				pageSizes: [10, 20, 30, 40],
				start: 1,
				end: 10,
				detailId: '',
				color: 'color:rgba(51, 153, 255, 1);',
				wfInstId: '',
				instNodeId: '',
				showFlowView: false,
				total: 0,
				visable: false,
				count: 100,
				isActive: 1,
				currentPage: 1,
				available: 'true',
				historyData: [],
				tableHeight: 0,
				options: [
					{
						value: 0,
						label: '近一周',
					},
					{
						value: 1,
						label: '近一月',
					},
					{
						value: 2,
						label: '近一年',
					},
				],
				types: [],
				extents: [
					{
						value: 0,
						label: '全部',
					},
					{
						value: 2,
						label: '紧急',
					},
					{
						value: 1,
						label: '重要',
					},
					{
						value: 3,
						label: '一般',
					},
				],
				sorts: [
					{
						value: 0,
						label: '时间排序',
					},
				],
				date: '',
				dateType: '',
				typeDate: {},
				beginTime1: '',
				endTime1: '',
				queryList: {
					// moduleId: "",
					level: null,
					msgType: 1,
					state: '3',
					keyword: '',
					beginTime: '',
					endTime: '',
					page: 0,
					pageSize: 10,
					time: '',
					xmmc: '',
					gcmc: '',
					formType: null,
				},
				// 标为已读可用不可用
				isAble: false,
				multipleSelection: [],
				// 表格数据
				tableData: [],
				// 表头数据
				tableLabel: [
					{
						label: '消息状态',
						width: '',
						prop: 'state',
					},
					{
						label: '紧急程度',
						width: '',
						prop: 'grade',
					},
					{
						label: '发送人',
						width: '',
						prop: 'from',
					},
					{
						label: '接收人',
						width: '',
						prop: 'accept',
					},
					{
						label: '主题',
						width: '',
						prop: 'title',
					},
					{
						label: '消息内容',
						width: '',
						prop: 'detail',
					},
					{
						label: '时间',
						width: 180,
						prop: 'time',
					},
				],
				tableShow: false,
				formTypeOpt: [
					{ name: '登记', value: 0 },
					{ name: '上架', value: 1 },
					{ name: '下架', value: 2 },
					{ name: '变更', value: 3 },
					{ name: '报废', value: 4 },
				],
			}
		},
		watch: {
			// $route: function() {
			// 	if (this.$route.name == "message") {
			// 		if (this.$route.params.row != undefined) {
			// 			this.goto("", this.$route.params.row.msgType);
			// 			this.queryList.state = "3";
			// 			this.queryList.msgType = this.$route.params.row.msgType;
			// 			//  显示详情
			// 			this.handleClick(this.$route.params.row);
			// 		}
			// 	} else {
			// 		return;
			// 	}
			// },
			'$store.state.commonData.curMsg': function(e) {
				this.goto('', e.msgType)
				this.queryList.state = '3'
				this.queryList.msgType = e.msgType
				this.dblclick(e)
			},
		},
		async mounted() {
			await this.getTableHeight()
			this.getTableHeader()
			this.searchState()
			this.queryData(0)
		},
		methods: {
			// 动态获取表头
			getTableHeader() {
				if (this.queryList.msgType === 1 || this.queryList.msgType === 2) {
					this.tableLabel = [
						// {
						// 	label: "项目名称",
						// 	width: "",
						// 	prop: "detail",
						// },
						{
							label: '任务编号',
							width: '',
							prop: 'xmName',
						},
						{
							label: '任务内容',
							width: '',
							prop: 'gcName',
						},
						{
							label: '流程状态',
							width: 100,
							prop: 'state',
						},
						{
							label: '发送人',
							width: 110,
							prop: 'from',
						},
						{
							label: '接收人',
							width: 110,
							prop: 'accept',
						},
						{
							label: '所属模块',
							width: '',
							prop: 'title',
						},
						{
							label: '时间',
							width: 180,
							prop: 'time',
						},
					]
				} else {
					this.tableLabel = [
						{
							label: '消息状态',
							width: 100,
							prop: 'state',
						},
						{
							label: '紧急程度',
							width: '',
							prop: 'grade',
						},
						{
							label: '发送人',
							width: '',
							prop: 'from',
						},
						{
							label: '接收人',
							width: '',
							prop: 'accept',
						},
						{
							label: '主题',
							width: '',
							prop: 'title',
						},
						{
							label: '消息内容',
							width: '',
							prop: 'detail',
						},
						{
							label: '时间',
							width: 180,
							prop: 'time',
						},
					]
				}
			},
			// table高度
			getTableHeight() {
				let that = this
				let contentHeight = document.getElementsByClassName('content-wrapper')[0].offsetHeight
				let searchesHeight = document.getElementsByClassName('searches-wrapper')[0].offsetHeight
				that.tableHeight = contentHeight - searchesHeight - 72
				let tableBodyHeight = that.tableHeight - 40
				that.queryList.pageSize = parseInt(tableBodyHeight / 40)
				this.end = parseInt(tableBodyHeight / 40)
				that.pageSizes.push(that.queryList.pageSize)
			},
			changeDate() {
				// 初始化时间
				this.queryList.beginTime = ''
				this.queryList.endTime = ''
				if (this.beginTime1) {
					this.dateType = ''
					this.queryList.beginTime = this.beginTime1
					this.queryList.endTime = this.beginTime1
				}
			},
			changeFormType(value) {
				this.queryList.formType = value
			},
			//创建时间修改
			change(value) {
				// 初始化时间
				this.beginTime1 = ''
				this.queryList.beginTime = ''
				this.queryList.endTime = ''
				let date = new Date()
				let list = []
				if (value === 0) {
					if (this.beginTime1) {
						list = this.getDateRange(this.beginTime1, 6, true)
						this.queryList.beginTime = list[0]
						this.queryList.endTime = list[1]
					} else {
						list = this.getDateRange(date, 6, true)
						this.queryList.beginTime = list[0]
						this.queryList.endTime = list[1]
					}
				} else if (value === 1) {
					list = this.getDateRange(date, 30, true)
					this.queryList.beginTime = list[0]
					this.queryList.endTime = list[1]
				} else {
					list = this.getDateRange(date, 365, true)
					this.queryList.beginTime = list[0]
					this.queryList.endTime = list[1]
				}
				this.queryData(0)
			},
			//时间计算
			getDateRange(dateNow, intervalDays, bolPastTime) {
				let oneDayTime = 24 * 60 * 60 * 1000
				let list = []
				let lastDay
				if (bolPastTime == true) {
					lastDay = new Date(dateNow.getTime() - intervalDays * oneDayTime)
					list.push(this.formateDate(lastDay))
					list.push(this.formateDate(dateNow))
				} else {
					lastDay = new Date(dateNow.getTime() + intervalDays * oneDayTime)
					list.push(this.formateDate(dateNow))
					list.push(this.formateDate(lastDay))
				}
				return list
			},
			//时间格式化
			formateDate(time) {
				let year = time.getFullYear()
				let month = time.getMonth() + 1
				let day = time.getDate()
				if (month < 10) {
					month = '0' + month
				}
				if (day < 10) {
					day = '0' + day
				}
				return year + '-' + month + '-' + day + ' ' + '00:00:00'
			},
			//关闭详情页面
			hide() {
				this.visable = false
				this.$refs.multipleTable.clearSelection()
				this.$refs.child.getList()
				// this.$refs.child.goto(this.typeDate, this.queryList.msgType - 1);
				this.queryData(0)
			},
			//关闭流程
			close() {
				this.showFlowView = false
				this.$refs.child.getList()
				// this.$refs.child.goto(this.typeDate, this.queryList.msgType - 1);
				this.queryData(0)
			},
			//关闭业务
			handleCellView() {
				this.cellViewShow = false
				this.cellViewShow1 = false
				this.$refs.child.getList()
				this.queryList.state = '3'
				this.searchState()
				this.getTableHeader()
				this.queryData(0)
				this.tableShow = false
			},
			handleBussinessView() {
				this.bussinessViewShow = false
				this.queryList.state = '3'
				this.getTableHeader()
				this.searchState()
				this.queryData(0)
			},
			read() {
				if (this.multipleSelection.length === 0 || this.isAble === 0) {
					return
				} else {
					let array = []
					let selection = this.multipleSelection
					Object.keys(selection).forEach(function(i) {
						array.push(selection[i].id)
					})
					let ids = array.join(',')
					if (ids == undefined || ids.length <= 0) {
						this.message('请先选中设为已读的数据！', 3)
						return false
					}
					let param = {
						ids: ids,
						msgType: this.queryList.msgType,
					}
					msgRead(param).then(res => {
						if (res.code == '200') {
							this.queryData()
						} else {
							this.message(res.msg, 3)
						}
					})
				}
			},
			goto(type, i) {
				this.tableShow = false
				this.queryList.msgType = parseInt(i) + 1
				this.searchState()
				this.getTableHeader()
				if (this.queryList.msgType <= 2) {
					this.queryList.state = '3'
				} else {
					this.queryList.state = '0'
				}
				this.currentPage = 1
				this.handleCurrentChange(this.currentPage)
			},
			searchState() {
				let param = {
					msgType: this.queryList.msgType,
				}
				msgState(param).then(res => {
					let dataObj = res.info[0]
					let arr = []
					for (let i in dataObj) {
						let o = {}
						o[i] = dataObj[i] //即添加了key值也赋了value值 o[i] 相当于o.name 此时i为变量
						arr.push(o)
					}
					this.types = []
					for (let j = 0; j < arr.length; j++) {
						let obj = {}
						for (var st in arr[j]) {
							obj['value'] = st
							obj['label'] = arr[j][st]
						}
						this.types.push(obj)
					}
				})
			},
			rowClick(row, col, event) {
				if (col.label !== '操作') {
					row.flag = !row.flag
					this.$refs.multipleTable.toggleRowSelection(row, row.flag)
				}
			},
			queryData(page) {
				if (page) {
					this.queryList.page = page - 1
					this.currentPage = page
				} else {
					this.queryList.page = 0
					this.currentPage = 1
				}
				msgList(this.queryList).then(res => {
					if (res.code == '200') {
						this.total = res.totalCount
						this.tableData = res.info
						if (res.totalCount < this.queryList.pageSize) {
							this.historyData = this.tableData
						} else {
							this.historyData = this.tableData.slice(0, this.queryList.pageSize)
						}
					} else {
						this.historyData = []
						this.currentPage = 1
						this.total = 0
					}
				})
				this.$refs.child.getList()
			},
			handleSizeChange(val) {
				this.queryList.pageSize = val
				this.start = 1
				this.end = val
				this.queryData(0)
			},
			handleCurrentChange(val) {
				this.start = this.queryList.pageSize * (val - 1) + 1
				this.end = this.queryList.pageSize * val
				this.queryData(val)
			},
			handleSelectionChange(val) {
				this.multipleSelection = val
				let count = 0
				for (let j = 0; j < this.multipleSelection.length; j++) {
					if (this.multipleSelection[j].state == 0) {
						count = count + 1
					}
				}
				this.isAble = count
			},
			select(e) {
				this.multipleSelection = e
			},
			selectAll(e) {
				this.multipleSelection = e
			},
			handleClick(row) {
				const msgWf = row.msgWf
				// 表单标记 0:登记;1:上架;2:下架;3:变更;4:报废
				if (msgWf) {
					switch (msgWf.formType) {
						case 0:
							this.$router.push(`/showAssetInfo/${msgWf.workId}`)
							break
						case 1:
							this.$router.push(`/assetPutawayInfo/${msgWf.workId}`)
							break
						case 2:
							this.$router.push(`/assetOutInfo/${msgWf.workId}`)
							break
						case 3:
							this.$router.push(`/assetChangeInfo/${msgWf.workId}`)
							break
						case 4:
							this.$router.push(`/assetScrapInfo/${msgWf.workId}`)
							break
						default:
							break
					}
				} else {
					this.$message.warning('消息内容异常')
				}
			},
			// async handleClick(row) {
			// 	console.log(row)
			// 	if (row.ord) {
			// 		this.cellViewShow1 = true
			// 		this.funcId = row.id
			// 		this.nodeId = 1
			// 	} else {
			// 		let type
			// 		if (row.msgType !== undefined) {
			// 			type = row.msgType
			// 		} else {
			// 			type = this.queryList.msgType
			// 		}

			// 		console.log(type)
			// 		this.msgId = row.id
			// 		if (type === 1) {
			// 			this.wfInstId = row.msgWf.wfinstId
			// 			this.instNodeId = row.msgWf.wfinstNodeId
			// 			this.showFlowView = true
			// 			this.finish = Boolean(row.state)
			// 			this.acceptTime = row.time
			// 		} else if (type === 5) {
			// 			this.isbrower = true
			// 			let obj = await this.getDetail(row.id, 5)
			// 			this.messagerForm = obj
			// 			this.visable = true
			// 		} else if (type === 2) {
			// 			let obj = await this.getDetail(row.id, 2)
			// 			this.wpId = obj.msgWp.wpId
			// 			this.funcId = obj.msgWp.funcId
			// 			this.funcName = obj.msgWp.funcName
			// 			this.tdeptId = obj.msgWp.tdeptId
			// 			this.tworkId = obj.msgWp.tworkId
			// 			this.nodeId = obj.msgWp.nodeId
			// 			this.wpPlanId = obj.msgWp.wpPlanId
			// 			this.wpNodeId = obj.msgWp.wpNodeId
			// 			this.wpInstNodeId = obj.msgWp.wpInstNodeId
			// 			this.tinstNodeId = obj.msgWp.tinstNodeId
			// 			this.wpInstId = obj.msgWp.wpInstId
			// 			this.bussinessViewShow = true
			// 			this.acceptTime = row.time
			// 		} else if (type === 3) {
			// 			this.isbrower = true
			// 			let obj = await this.getDetail(row.id, 3)
			// 			this.messagerForm = obj
			// 			this.visable = true
			// 		}
			// 		this.readOnly(row)
			// 	}
			// },
			async getDetail(id, type) {
				let info = null
				let param = {
					id: id,
					msgType: type,
				}
				await msgDetail(param).then(res => {
					info = res.info
					this.getWorkRepdeptId = res.info.msgWf.deptId
					console.log(this.getWorkRepdeptId)
				})
				return info
			},
			async dblclick(row) {
				// 双击表单
				// console.log(row);
				let type
				if (row.msgType !== undefined) {
					type = row.msgType
				} else {
					type = this.queryList.msgType
				}
				if (type === 5 || type === 3) {
					this.handleClick(row)
				} else if (type === 2) {
					this.msgId = row.id
					this.wpmessage()
				} else if (type === 1) {
					let obj = await this.getDetail(row.id, 1)
					this.tdeptId = obj.msgWf.deptId
					this.tworkId = obj.msgWf.workId
					if (obj.msgWf.repId) {
						this.wpId = obj.msgWf.repId.toString()
					}
					this.wfInstId = obj.msgWf.wfinstId
					this.instNodeId = obj.msgWf.wfinstNodeId
					this.nodeId = 1
					this.showCell = true
				}
			},
			wpmessage() {
				//获取  表单信息
				wpmessage({
					wpInstUserId: this.msgId,
				}).then(res => {
					if (res.success) {
						if (res.info.formIdArr || res.info.menuId) {
							//如果 表单id  为空   那么 要打开vue 文件
							this.wpId = res.info.formIdArr //多表单 用逗号隔开
							this.tworkId = res.info.dataId
							this.wpInstNodeId = res.info.wpinstNodeId
							this.funcName = res.info.menuName
							this.funcId = res.info.menuId
							this.businessInfo = res.info.businessInfo
							this.cellViewShow = true
						}
					}
				})
			},
			closeCell() {
				this.showCell = false
			},
			readOnly(data) {
				if (data.isWirte == '0') {
					let param = {
						ids: data.id,
						msgType: this.queryList.msgType,
					}
					msgRead(param).then(res => {
						if (res.code == '200') {
							this.queryData()
						} else {
							this.message(res.msg, 3)
						}
					})
				}
			},
			async work() {
				const res = await workList()
				this.historyData = res.info
				this.tableShow = true
			},
			btnClick1() {
				if (this.historyData[0].name) {
					this.cellViewShow1 = true
					this.wpId = this.multipleSelection[0].id
					this.funcId = this.multipleSelection[0].id
				}
			},
		},
	}
</script>

<style scoped>
	.content {
		width: 100%;
		border-radius: 6px;
		height: calc(100% - 68px);
		display: flex;
		flex-direction: row;
		background: var(--content-bg-color);
		min-width: 1024px;
	}

	>>> .iconkuangjia-sousuo {
		color: #848efc;
		margin-right: 7px;
	}

	.systemPage-wrapper .query-box {
		margin-left: 15px !important;
	}
</style>
<style></style>
